<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="ctx" value="${pageContext.request.contextPath}"></c:set>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>添加供应商</title>

    <link rel="shortcut icon" href="${ctx}/favicon.ico"> <link href="${ctx}/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="${ctx}/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="${ctx}/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="${ctx}/css/animate.css" rel="stylesheet">
    <link href="${ctx}/css/style.css?v=4.1.0" rel="stylesheet">

</head>
<body>
        <div class="ibox-content" style="padding-top:70px;">
                <form class="form-horizontal">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">供应商公司名：</label>
        
                        <div class="col-sm-4">
                                <input type="text" class="form-control" autocomplete="off" name="supplier_" value="${supplier.supplier_}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">联系人：</label>
                        <div class="col-sm-4">
                            <input type="text" class="form-control" autocomplete="off" name="supplier_name" value="${supplier.supplier_name}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">联系电话：</label>
        
                        <div class="col-sm-4">
                                <input type="text"  class="form-control" autocomplete="off" name="telephone" value="${supplier.telephone}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">公司地址：</label>
                        <div class="col-sm-4">
                            <input type="text"  class="form-control" autocomplete="off" name="supplier_address" value="${supplier.supplier_address}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">主营业务：</label>
                        <div class="col-sm-4">
                                <input type="text"  class="form-control" autocomplete="off" name="main_business" value="${supplier.main_business}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">备注：</label>
                        <div class="col-sm-4">
                                <input type=""  class="form-control" autocomplete="off" name="remark" value="${supplier.remark}">
                        </div>
                    </div>
                    <div class="form-group" style="margin-top:30px;">
                        <div class="col-sm-offset-4 col-sm-8">
                            <div class="btn btn-sm btn-white" type="submit" onclick="submitForm()">添加供应商</div>
                        </div>
                    </div>
                    <input type="hidden" name="supplier_id" value="${supplier.supplier_id}"/>
                </form>
            </div>
            
</body>
    <!-- 全局js -->
    <script src="${ctx}/js/jquery.min.js?v=2.1.4"></script>
    <script src="${ctx}/js/bootstrap.min.js?v=3.3.6"></script>
    <script src="${ctx}/dist\layer-v3.1.1\layer\layer.js"></script>
    <script type="text/javascript">
    function submitForm() {
		//alert($('#purchase_people_id').val());
		$.get('${ctx}/SupplierServlet/editSupplier',$('form').serialize(),function(data){			
			if(data){
				parent.layer.msg('修改成功！');
				window.parent.location.reload();//刷新父页面
				parent.layer.close(index);//关闭当前的弹窗
			}else{
				parent.layer.msg('修改失败！');
				window.parent.location.reload();//刷新父页面
				parent.layer.close(index);//关闭当前的弹窗
			}
		});
	}
    </script>
</html>